import 'package:flutter/material.dart';

main() => runApp(const PersistentBottomSheetWidgetWidget());

class PersistentBottomSheetWidgetWidget extends StatelessWidget {
  const PersistentBottomSheetWidgetWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Test',
      home: Scaffold(
        appBar: AppBar(title: const Text('Flutter UI Widget -- BottomSheet')),
        body: Builder(
          builder: (context) {
            return ElevatedButton(
              onPressed: () {},
              child: const Text('showBottomSheet'),
            );
          },
        ),
        bottomSheet: BottomSheet(
            onClosing: () {},
            builder: (context) => Container(
                  height: 200.0,
                  color: Colors.blue,
                  child: Center(
                    child: ElevatedButton(
                      onPressed: () {
                        Navigator.of(context).pop();
                      },
                      child: const Text('dismissBottomSheet'),
                    ),
                  ),
                )),
      ),
    );
  }
}
